﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using static DotnetFramework.CAP.IocRefction.Container;

namespace DotnetFramework.CAP.IocRefction
{
    public interface IContainer
    {
        T Resolve<T>();
        object Resolve(Type serviceType);
        object ResolveNamed(string name, Type serviceType);


        #region Register begin
        ContainerBuilder Register<T, T2>(Func<object, object> func);
        ContainerBuilder RegisterInstance<T, T2>(T instance);
        ContainerBuilder RegisterGeneric(Type type, Type serverType,bool isSingle = false);
        ContainerBuilder RegisterGenericNamed(Type type, Type serverType, string name, bool isSingle = false);
        ContainerBuilder RegisterType<T, T2>(bool isSingle = false);
        ContainerBuilder RegisterTypeNamed<T,T2>(string typeName, bool isSingle = false);
        ContainerBuilder TryAddEnumerable(Type type, Type serverType);
        #endregion Register end
    }
}
